package com.rzhd.coursepatriarch.common.constants;

import com.rzhd.coursepatriarch.common.utils.CommonUtil;

/**
 * @author yql
 * @date: 2018/10/9.
 */
public class HttpConstants {

    public static final long TIME_OUT = 15 * 1000;


    public static String BASE_HOST = "";
    public static String PRODUCT_NAME = "";
    public static String BASE_URL = "";

//    public static final String BASE_HOST = "http://47.93.16.203:8018/";         //测试
//    public static final String BASE_HOST = "http://youtangke.irzhd.cn:12000/";         //正式

    /**
     * 有赞链接
     * @param base
     */
    public static String YOUZAN_SHOP_LINK = "https://shop42268015.youzan.com/v2/feature/YT6fHpfPVw";
//    public static String YOUZAN_SHOP_LINK = "https://shop44732717.youzan.com/v2/feature/FZOY53c8wa";
    /**
     * H5地址
     */
    public static final String BASE_HTML_LOCATION_URL = BASE_HOST + "dist/index.html#/";

    /**
     * 服务器地址
     */
//    public static final String BASE_URL = BASE_HOST + "youtangke/ytkapp/";        //测试
//    public static final String BASE_URL = BASE_HOST + "ytkapp/";                    //正式

    /**
     * okHttp默认缓存存储文件夹
     */
    public static final String CACHE = "MyCache";

    // 200 成功 500系统错误 2001
    public static final int RESPONSE_CODE_200 = 200;
    public static final int RESPONSE_CODE_500 = 500;
    public static final int RESPONSE_CODE_2001 = 2001;
    //token过期
    public static final int RESPONSE_CODE_700 = 700;
    //token过期
    public static final int RESPONSE_CODE_1010 = 1010;
    //token验证失败
    public static final int RESPONSE_CODE_701 = 701;
    //签名验证失败
    public static final int RESPONSE_CODE_702 = 702;

    public static String getUrlPath( String url ){
        return BASE_HOST + url;
    }

    /**
     * 邀请加入
     * @return
     */
    public static String getInviteUrl(  String classId ){
        StringBuilder builder = new StringBuilder();
        builder.append( BASE_HOST ).append( "/dist#/thirdparty/thirdparty_register?" )
                .append( "classId=" ).append( classId );
        return builder.toString();
    }

    public static String getShareCourseUrl(  String mechanismId , String courseId , String userId , String isSpecial){
        StringBuilder builder = new StringBuilder();
        builder.append( BASE_HOST ).append( "/dist#/thirdparty/thirdparty_foreshow?" )
                .append( "mechanismId=" ).append( mechanismId )
                .append( "&courseId=" ).append( courseId )
                .append( "&userId=" ).append( userId )
                .append( "&isSpecial=" ).append( isSpecial );
        return builder.toString();
    }

}
